class ItemStylesController < ApplicationController
  def index
    @item_styles = ItemStyle.all
  end
  
  def show
    @item_style = ItemStyle.find(params[:id])
  end
  
  def new
    @item_style = ItemStyle.new
  end
  
  def create
    @item_style = ItemStyle.new(params[:item_style])
    if @item_style.save
      flash[:notice] = "Successfully created item style."
      redirect_to @item_style
    else
      render :action => 'new'
    end
  end
  
  def edit
    @item_style = ItemStyle.find(params[:id])
  end
  
  def update
    @item_style = ItemStyle.find(params[:id])
    if @item_style.update_attributes(params[:item_style])
      flash[:notice] = "Successfully updated item style."
      redirect_to @item_style
    else
      render :action => 'edit'
    end
  end
  
  def destroy
    @item_style = ItemStyle.find(params[:id])
    @item_style.destroy
    flash[:notice] = "Successfully destroyed item style."
    redirect_to admin_item_styles_url
  end
end
